import {createRouter, createWebHistory} from 'vue-router'
import Login from '../components/Login.vue'
import Chat from '../views/Chat.vue'
import Layout from '../components/Layout.vue'

const routes = [
    {
        path: '/',
        component: Layout,
        meta: {requiresAuth: true},
        children: [
            {
                path: '',
                name: 'Chat',
                component: Chat,
            }
        ]
    },
    {
        path: '/login',
        name: 'Login',
        component: Login
    },
]

const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router